\(\int \frac {(a+b x) (A+B x)}{x} \, dx\) [85]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 24 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=(A b+a B) x+\frac {1}{2} b B x^2+a A \log (x) \]

[Out]

(A*b+B*a)*x+1/2*b*B*x^2+a*A*ln(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {77} \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=x (a B+A b)+a A \log (x)+\frac {1}{2} b B x^2 \]

[In]

Int[((a + b*x)*(A + B*x))/x,x]

[Out]

(A*b + a*B)*x + (b*B*x^2)/2 + a*A*Log[x]

Rule 77

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps \begin{align*} \text {integral}& = \int \left (A b+a B+\frac {a A}{x}+b B x\right ) \, dx \\ & = (A b+a B) x+\frac {1}{2} b B x^2+a A \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=(A b+a B) x+\frac {1}{2} b B x^2+a A \log (x) \]

[In]

Integrate[((a + b*x)*(A + B*x))/x,x]

[Out]

(A*b + a*B)*x + (b*B*x^2)/2 + a*A*Log[x]

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92

method result size
default \(\frac {b B \,x^{2}}{2}+A b x +B a x +a A \ln \left (x \right )\) \(22\)
risch \(\frac {b B \,x^{2}}{2}+A b x +B a x +a A \ln \left (x \right )\) \(22\)
parallelrisch \(\frac {b B \,x^{2}}{2}+A b x +B a x +a A \ln \left (x \right )\) \(22\)
norman \(\left (A b +B a \right ) x +\frac {b B \,x^{2}}{2}+a A \ln \left (x \right )\) \(23\)

[In]

int((b*x+a)*(B*x+A)/x,x,method=_RETURNVERBOSE)

[Out]

1/2*b*B*x^2+A*b*x+B*a*x+a*A*ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=\frac {1}{2} \, B b x^{2} + A a \log \left (x\right ) + {\left (B a + A b\right )} x \]

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="fricas")

[Out]

1/2*B*b*x^2 + A*a*log(x) + (B*a + A*b)*x

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=A a \log {\left (x \right )} + \frac {B b x^{2}}{2} + x \left (A b + B a\right ) \]

[In]

integrate((b*x+a)*(B*x+A)/x,x)

[Out]

A*a*log(x) + B*b*x**2/2 + x*(A*b + B*a)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=\frac {1}{2} \, B b x^{2} + A a \log \left (x\right ) + {\left (B a + A b\right )} x \]

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="maxima")

[Out]

1/2*B*b*x^2 + A*a*log(x) + (B*a + A*b)*x

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=\frac {1}{2} \, B b x^{2} + B a x + A b x + A a \log \left ({\left | x \right |}\right ) \]

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="giac")

[Out]

1/2*B*b*x^2 + B*a*x + A*b*x + A*a*log(abs(x))

Mupad [B] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {(a+b x) (A+B x)}{x} \, dx=x\,\left (A\,b+B\,a\right )+\frac {B\,b\,x^2}{2}+A\,a\,\ln \left (x\right ) \]

[In]

int(((A + B*x)*(a + b*x))/x,x)

[Out]

x*(A*b + B*a) + (B*b*x^2)/2 + A*a*log(x)